<template>

    <div>
            <div class="about-page">
             <el-row>
            <el-col :span="12">
                <el-card>
                                                                                                                                                                                                                                                                                                                                                                                                                                                </el-card>
            </el-col>
            <el-col :span="12">
                <el-row>
                                                                                                                                    
                            <el-col :span="24">
                                <el-card>账号:{{ detail.zhanghao }}</el-card>
                            </el-col>
                                                                                                                
                            <el-col :span="24">
                                <el-card>年龄:{{ detail.nianling }}</el-card>
                            </el-col>
                                                                    
                            <el-col :span="24">
                                <el-card>性别:{{ detail.xingbie }}</el-card>
                            </el-col>
                                                                    
                            <el-col :span="24">
                                <el-card>联系方式:{{ detail.lianxifangshi }}</el-card>
                            </el-col>
                                                                                                                
                            <el-col :span="24">
                                <el-card>名字:{{ detail.mingzi }}</el-card>
                            </el-col>
                                                                <el-col :span="24">
                        <el-card>

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </el-card>

                    </el-col>
                </el-row>


            </el-col>
        </el-row>

                <div style="height: 50px;"></div>
                                                                    

                                                                    

                                                                    

                                                                    

                                                                    

                                                                    

                                                                    

                                                                    

                                                                    

                            </div>
        
             </div>
</template>


<script setup>

    import { defineAsyncComponent,reactive,ref,toRefs } from 'vue';
    import { toRaw } from "@vue/reactivity";
    import { Key } from '@/stores/auth';
    import { Session } from '@/utils/storage';
    import request from "@/utils/request";
    import {notify,confirm} from '@/utils/element';
    import { isAuth } from '@/utils/utils'
    import { ElLoading } from 'element-plus'


    import { useRoute } from 'vue-router'

    const route = useRoute()

    // 打印
    const id=route.params.id
    request({
        url: `yonghu/info/${id}`,
        method: "get"
    }).then((data) => {
        if (data && data.code === 0) {
        state.detail=data.data;

            } else {
        notify(data.msg,{type:'error'});
    }
    });

            const state=reactive({
        detail:{},
        user:{},
        pinglunDate:[],
                detailTable:'yonghu',
        formData:{
            userid:"",
            nickname:"",
            refid:"",
            content:""
        },
        detailFlag:false,
        islogin:'',
    })


    const {detail,user,pinglunDate,detailFlag,
                detailTable,
        formData,
        islogin,
    } = {...toRefs(state)};


    if(Session.get(Key.isLoingKey)==null){
        state.islogin='0';
    }else{
        state.islogin=Session.get(Key.isLoingKey);
    }


                

        





  if(state.islogin=='1'){
      let sessionTable = Session.get("tableName")
      request({
          url: sessionTable + '/session',
          method: "get"
      }).then((
              data
      ) => {
          if (data && data.code === 0) {
          state.user = data.data;
       } else {
          notify(data.msg,{type:'error'});


      }
  });
  }



 
    function download(file) {
 if(state.islogin=='1'){
        window.open(`${file}`)
  }else{
       notify("请登录",{type:'error'});
   }
    }



    function init(id){
        state.detailFlag=true;
        info(id);
            }
    function info(id) {
        request({
            url: `yonghu/info/${id}`,
            method: "get"
        }).then((data) => {
            if (data && data.code === 0) {
            state.detail=data.data;
        } else {
            notify(data.msg,{type:'error'});
        }
    });
    }



        



        

        







</script>

<style scoped>
                
        
</style>
